﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	/// <summary>
	/// 微信模板消息配置
	/// </summary>
	[Table("WX_TplMsgConfig")]
	public partial class WX_TplMsgConfig
	{
		[Key]
		[Column("ID")]
		public int ID { get; set; }

		/// <summary>
		/// 应用ID
		/// </summary>
		[Column("AppID")]
		[StringLength(32, ErrorMessage = "{0}长度不能超过{1}")]
		public string AppID { get; set; }

		/// <summary>
		/// 模板类型（用来区分发送哪种类型模板消息）
		/// </summary>
		[Column("Type")]
		public int Type { get; set; }

		/// <summary>
		/// 微信的私有模板id
		/// </summary>
		[Column("Code")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Code { get; set; }

		/// <summary>
		/// 模板标题
		/// </summary>
		[Column("Title")]
		[StringLength(10, ErrorMessage = "{0}长度不能超过{1}")]
		public string Title { get; set; }

		/// <summary>
		/// 模板跳转链接（海外帐号没有跳转能力）
		/// </summary>
		[Column("Url")]
		[StringLength(200, ErrorMessage = "{0}长度不能超过{1}")]
		public string Url { get; set; }

		/// <summary>
		/// 所需跳转到的小程序appid（该小程序appid必须与发模板消息的公众号是绑定关联关系，暂不支持小游戏）
		/// </summary>
		[Column("XCXID")]
		[StringLength(30, ErrorMessage = "{0}长度不能超过{1}")]
		public string XCXID { get; set; }

		/// <summary>
		/// 所需跳转到小程序的具体页面路径，支持带参数,（示例index?foo=bar），要求该小程序已发布，暂不支持小游戏
		/// </summary>
		[Column("XCXPagePath")]
		[StringLength(300, ErrorMessage = "{0}长度不能超过{1}")]
		public string XCXPagePath { get; set; }

		/// <summary>
		/// 模板内容
		/// </summary>
		[Column("Tpl")]
		[StringLength(1000, ErrorMessage = "{0}长度不能超过{1}")]
		public string Tpl { get; set; }

		/// <summary>
		/// 模板示例
		/// </summary>
		[Column("Example")]
		[StringLength(2000, ErrorMessage = "{0}长度不能超过{1}")]
		public string Example { get; set; }

		/// <summary>
		/// 排序
		/// </summary>
		[Column("Sort")]
		public int Sort { get; set; }

		/// <summary>
		/// 描述
		/// </summary>
		[Column("Comment")]
		[StringLength(50, ErrorMessage = "{0}长度不能超过{1}")]
		public string Comment { get; set; }

		/// <summary>
		/// 模板消息状态（正常、已停用）
		/// </summary>
		[Column("StateNow")]
		public int StateNow { get; set; }

		/// <summary>
		/// 创建时间
		/// </summary>
		[Column("AddDate")]
		public DateTime AddDate { get; set; }

		/// <summary>
		/// 创建人ID
		/// </summary>
		[Column("AddManID")]
		[JsonIgnore]
		public int AddManID { get; set; }

		/// <summary>
		/// 创建人
		/// </summary>
		[Column("AddManName")]
		[StringLength(20, ErrorMessage = "{0}长度不能超过{1}")]
		public string AddManName { get; set; }

	}
}
